package cn.signalpha.modules.shop.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 用户收货地址实体类
 *
 * @author suguangjun
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("shop_user_address")
@ApiModel(value = "UserAddress对象", description = "用户收货地址")
public class UserAddress implements Serializable {

    private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "用户id")
    private Long userId;

	@NotBlank
    @ApiModelProperty(value = "收货人")
    private String consignee;

	@NotBlank
    @ApiModelProperty(value = "手机")
    private String mobile;

	@NotBlank
    @ApiModelProperty(value = "省")
    private String province;

	@NotBlank
    @ApiModelProperty(value = "市")
    private String city;

	@NotBlank
    @ApiModelProperty(value = "区")
    private String district;

	@NotBlank
    @ApiModelProperty(value = "地址")
    private String address;

	@ApiModelProperty(value = "经度")
	private String lng;

	@ApiModelProperty(value = "纬度")
	private String lat;

	@NotNull
    @ApiModelProperty(value = "是否默认")
    private Integer isDefault;

}
